import TableFilePlan from "./TableFilePlan"
import IconFilePlan from "./IconFilePlan"
import { useSearchParams } from "react-router-dom"

type FileViewContentProps = {
  viewType: "list" | "icon"
}

export default function FileViewContent({ viewType }: FileViewContentProps) {

  const [searchParams] = useSearchParams()
  const dirPath = searchParams.get('path') || "./";

  return <div>
    {viewType === "list" && <TableFilePlan direct_path={dirPath} />}
    {viewType === "icon" && <IconFilePlan direct_path={dirPath} />}
  </div>
}

